//
//  MPMoreViewController.m
//  sanguosha
//
//  Created by caiqilin on 2017/6/30.
//  Copyright © 2017年 caiqilin. All rights reserved.
//

#import "MPMoreViewController.h"
#import "MPMeCell.h"
#import "MPMeHeadViewCell.h"
#import "MPVersionViewCell.h"
#import "MPContactUsViewController.h"
//// 弹出分享菜单需要导入的头文件
//#import <ShareSDKUI/ShareSDK+SSUI.h>
//// 自定义分享菜单栏需要导入的头文件
//#import <ShareSDKUI/SSUIShareActionSheetStyle.h>
//#import <ShareSDKUI/SSUIEditorViewStyle.h>
@interface MPMoreViewController ()

@end

@implementation MPMoreViewController

- (instancetype)init
{
    return [self initWithStyle:UITableViewStyleGrouped];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupTable];
    
    [self setupNav];
}

- (void)setupTable
{
    self.tableView.backgroundColor = [Util stringTOColor:@"#f2f2f2"];
    self.tableView.sectionHeaderHeight = 0;
    self.tableView.sectionFooterHeight = MPMargin;
    self.tableView.contentInset = UIEdgeInsetsMake(MPMargin - 35, 0, 0, 0);
    
}

- (void)setupNav
{
    // 标题
    self.navigationItem.title = @"更多";
}

#pragma mark - 数据源方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 3;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 1;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // 4.设置数据
    if (indexPath.section == 0) {
        MPMeHeadViewCell *head = [MPMeHeadViewCell cellWithTableView:tableView];
        return head;
        
    }
    //    else  if (indexPath.section == 1) {
    //        MPMeCell *cell = [MPMeCell cellWithTableView:tableView];
    //        cell.textLabel.text = @"分享三国杀助手给好友";
    //        return cell;
    //    }
    else  if (indexPath.section == 1) {
        MPMeCell *cell = [MPMeCell cellWithTableView:tableView];
        cell.textLabel.text = @"联系我们";
        return cell;
    }
    //    else  if (indexPath.section == 3) {
    //        MPMeCell *cell = [MPMeCell cellWithTableView:tableView];
    //        cell.textLabel.text = @"意见反馈";
    //        return cell;
    //    }
    MPVersionViewCell *cell = [MPVersionViewCell cellWithTableView:tableView];
    
    cell.textLabel.text = @"版本信息";
    cell.rightLabel.text = @"v1.0";
    return cell;
    
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    if(indexPath.section == 0){
        return 100;
    }
    return 50;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    //    if(indexPath.section == 1){
    ////        [self shareWx];
    //    }else
    if(indexPath.section == 1){
        MPContactUsViewController *contact = [[MPContactUsViewController alloc] init];
        [self.navigationController pushViewController:contact animated:YES];
    }
}

//- (void)shareWx {
//    //1、创建分享参数（必要）
//    NSMutableDictionary *shareParams = [NSMutableDictionary dictionary];
//    NSArray* imageArray = @[[UIImage imageNamed:@"图片名.png"]];
//    [shareParams SSDKSetupShareParamsByText:@"分享内容"
//                                     images:imageArray
//                                        url:[NSURL URLWithString:@"http://mob.com"]
//                                      title:@"分享标题"
//                                       type:SSDKContentTypeAuto];
//
//    // 设置分享菜单栏样式（非必要）
//    // 设置分享菜单的背景颜色
//    [SSUIShareActionSheetStyle setActionSheetBackgroundColor:[UIColor colorWithRed:249/255.0 green:0/255.0 blue:12/255.0 alpha:0.5]];
//    // 设置分享菜单颜色
//    [SSUIShareActionSheetStyle setActionSheetColor:[UIColor colorWithRed:21.0/255.0 green:21.0/255.0 blue:21.0/255.0 alpha:1.0]];
//    // 设置分享菜单－取消按钮背景颜色
//    [SSUIShareActionSheetStyle setCancelButtonBackgroundColor:[UIColor colorWithRed:21.0/255.0 green:21.0/255.0 blue:21.0/255.0 alpha:1.0]];
//    // 设置分享菜单－取消按钮的文本颜色
//    [SSUIShareActionSheetStyle setCancelButtonLabelColor:[UIColor blackColor]];
//    // 设置分享菜单－社交平台文本颜色
//    [SSUIShareActionSheetStyle setItemNameColor:[UIColor whiteColor]];
//    // 设置分享菜单－社交平台文本字体
//    [SSUIShareActionSheetStyle setItemNameFont:[UIFont systemFontOfSize:10]];
//    //设置分享编辑界面的导航栏颜色
//    [SSUIEditorViewStyle setiPhoneNavigationBarBackgroundColor:[UIColor blackColor]];
//    //设置编辑界面标题颜色
//    [SSUIEditorViewStyle setTitleColor:[UIColor redColor]];
//    //设置取消发布标签文本颜色
//    [SSUIEditorViewStyle setCancelButtonLabelColor:[UIColor blueColor]];
//    [SSUIEditorViewStyle setShareButtonLabelColor:[UIColor blueColor]];
//    //设置分享编辑界面状态栏风格
//    [SSUIEditorViewStyle setStatusBarStyle:UIStatusBarStyleLightContent];
//    //设置简单分享菜单样式
//    [SSUIShareActionSheetStyle setShareActionSheetStyle:ShareActionSheetStyleSimple];
//
//    [ShareSDK showShareActionSheet:self.view items:nil shareParams:shareParams onShareStateChanged:^(SSDKResponseState state, SSDKPlatformType platformType, NSDictionary *userData, SSDKContentEntity *contentEntity, NSError *error, BOOL end) {
//        
//    }];
//   
//}
//

@end
